package com.ruicar.afs.cloud.channel.cardealer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruicar.afs.cloud.channel.cardealer.condition.CarDealerCondition;
import com.ruicar.afs.cloud.channel.cardealer.condition.DirectCarDealerCondition;
import com.ruicar.afs.cloud.channel.cardealer.entity.CommonCarDealer;
import com.ruicar.afs.cloud.channel.cardealer.vo.CarDealerVo;
import com.ruicar.afs.cloud.channel.cardealer.vo.ChannelInfoVo;
import com.ruicar.afs.cloud.channel.cardealer.vo.CommonCarDealerVo;
import com.ruicar.afs.cloud.channel.cardealer.vo.DirectCarDealerVo;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: sang jian
 * @date: 2020/5/14 10:53
 * @description:
 */

public interface CarDealerMapper extends BaseMapper<CommonCarDealer> {
    IPage<CommonCarDealerVo> getCommonCarDealerList(Page page, @Param("query") CarDealerCondition carDealerCondition);

    IPage<CommonCarDealerVo> getCommonCarDealerListForApply(Page page, @Param("query") CarDealerCondition carDealerCondition);

    /**
     * 根据车商id查询对应的渠道信息
     */
    List<ChannelInfoVo> getChannelsByCardealerId(String id);




    /**
     * 禁用普通车商
     */
    int diableCarDealer(@Param("channelId") String channelId, @Param("id") String id);


    /**
     * 根据登录账户和车商类型获取车商列表
     */
    ArrayList<CarDealerVo> getDirectCarDealersByUserId(@Param("userId") String userId, @Param("cardealerType") String cardealerType);

    ArrayList<CarDealerVo> getCommonCarDealersByUserId(@Param("userId") String userId, @Param("cardealerType") String cardealerType);

    /**
     * 多条件获取直营车商列表
     */
    IPage<DirectCarDealerVo> getDirectCarDealerList(Page page, @Param("query") CarDealerCondition carDealerCondition);

    /**
     * @Describe 根据车商代码获取合作车商信息
     * Created on 2020-06-27
     * @author tiankai
     */
    IPage<CommonCarDealerVo> getCarDealerListByCode(Page page, @Param("query") CarDealerCondition carDealerCondition);

    /**
     * 多条件获取展业区域
     */
    IPage<DirectCarDealerVo> getAreaListInfo(Page page, @Param("query") DirectCarDealerCondition condition);

    IPage<DirectCarDealerVo> getDirectCarDealerListForApply(Page page, @Param("query") CarDealerCondition carDealerCondition);
}
